<template>
	<view class="conn">
		<!-- 	<image class="top"
			src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fa3f7fe9d-7fc0-459f-bfad-384f8c7baceb%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1705739100&t=56fb5506effa32fdc41e1935e0e50ed2">
		</image> -->
		<view class="top"></view>
		<view class="con">
			<view class="title">
				<image style="margin-left: 50rpx;" :src="user.picUrl" @click="getobj(user.id)" />
				<view style="margin-left: 50rpx;">
					<view style="font-size: 21px;" @click="turnsuser()">{{user.nickName}}</view>
					<view style="display: flex;align-items: center;" @click="ediTab()">
						<u-icon name="edit-pen" color="#a3a3a3" size="28"></u-icon>
						<view style="height: 20rpx;height: 100%;"></view>
						<view style="font-size: 13px;color: gray;">
							{{user.userTab===''||user.userTab===null?'快去设置个性签吧':user.userTab}}
						</view>
					</view>
				</view>
			</view>
			<view class="parent">
				<view class="content">
					<u-cell-group>
						<u-cell title="个人账单" value="博主内容负责声明" isLink url="/pages/account/account" @click="turn(1)">
							<u-icon color="#ff6123" slot="icon" size="30" name="coupon"></u-icon>
						</u-cell>
						<u-cell title="个人相册" value="查看系统实时消息" isLink url="/pages/picture/picture" @click="turn(2)">
							<u-icon color="#ffffae" slot="icon" size="30" name="bell"></u-icon>
						</u-cell>
						<u-cell title="个人动态" value="当前版本v1.0.0" isLink url="/pagesa/FrentsSi/FrentsSi">
							<u-icon color="#e9c5ff" slot="icon" size="30" name="calendar"></u-icon>
						</u-cell>
						<u-cell title="清除缓存" :value="size+'bit'" isLink @click="clear()">
							<u-icon color="#ffa05c" slot="icon" size="32" name="trash"></u-icon>
						</u-cell>
						<u-cell title="系统消息" value="查看系统实时消息" isLink url="/pagesa/systemNews/systemNews">
							<u-icon color="#ffffae" slot="icon" size="32" name="bell"></u-icon>
						</u-cell>
						<u-cell title="应用设置" value="进入系统常用设置" isLink url="/pagesa/ssetting/ssetting">
							<u-icon color="#544e47" slot="icon" size="32" name="setting">
							</u-icon>
						</u-cell>

					</u-cell-group>

				</view>
			</view>
		</view>
		<u-popup :show="show" @close="close" @open="open" mode="center" round="10" zoom="false">
			<view>
				<view style="display: flex;align-items: center;justify-content: flex-start;width: 520rpx;">
					<view style="margin-left: 50rpx;"></view>
					<u-image :src="userObj.picUrl" :lazy-load="true" mode="aspectFit" width="70" height="70"></u-image>
					<view style="margin-left: 32rpx;">
						<u--text type="primary" :text="userObj.nickName"></u--text>
						<view style="display: flex;align-items: center;justify-content: start;margin-top: 20rpx;">
							<u-tag :text="'Id:'+userObj.id" size="mini" type="warning"></u-tag>
						</view>
					</view>
				</view>
				<view style="margin-left: 34rpx;margin-top: 20rpx;" v-if="userObj.phone">
					手机号：{{ userObj.phone}}
				</view>
				<view style="margin-left: 34rpx;margin-top: 20rpx;" v-if="userObj.email">
					邮箱：{{ userObj.email}}
				</view>
				<view style="margin-left: 34rpx;margin-top: 20rpx;padding-bottom: 25rpx;">
					简介：{{userObj.userTab===''?'这个人很懒。什么都没写':userObj.userTab}}
				</view>

			</view>
		</u-popup>
		<!-- 	<u-tabbar :value="value1" @change="change1" :fixed="false" :placeholder="false" :safeAreaInsetBottom="false">
			<u-tabbar-item text="首页" icon="home" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="待定" icon="photo" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="直播" icon="play-right" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="待定" icon="photo" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="设置" icon="account" @click="click1"></u-tabbar-item>
		</u-tabbar> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userObj: {},
				show: '',
				value1: 0,
				user: uni.getStorageSync("user"),
				size: '',
			}
		},
		onLoad() {
			let storageInfo = uni.getStorageInfoSync();
			this.size = storageInfo.currentSize;
		},
		methods: {
			ediTab(){
				uni.navigateTo({
					url:'/pagesa/ediTab/ediTab'
				})
			},
			turnsuser() {
				uni.navigateTo({
					url: '/pagesa/usesrinfo/usesrinfo'
				})
			},
			turn(id) {
				console.log(id)
				uni.switchTab({
					url: id === 1 ? '/pages/account/account' : '/pages/picture/picture'
				})
			},
			clear() {
				uni.showLoading({
					title: '加载中'
				});
				setTimeout(function() {
					uni.hideLoading();
					uni.clearStorageSync();
					uni.showToast({
						icon: "none",
						title: "清理成功"
					})
				}, 2000);
			},
			show1() {
				uni.showToast({
					title: this.title,
					icon: "none"
				})
			},
			change1(name) {
				this.value1 = name
			},
			click1(e) {
				if (e === 0) {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}
				console.log('click1', e);
			},
			async getobj(id) {
				const res = await this.$myRuquest({
					url: '/wexinLogin/getUser?userId=' + id,
					method: 'post',
				})
				this.userObj = res.data.data
				this.show = true
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
		}
	}
</script>

<style lang="scss" scoped>
	.flex {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		background-color: #f5f5f5;
		font-size: 16px;
	}

	.conn {

		// background-color: #f5f5f5;
		.top {
			background-size: cover;
			background-image: url("https://5b0988e595225.cdn.sohucs.com/images/20190620/7a304fa2ac52408597f6a17f98e56ee3.gif");
			width: 100%;
			height: 380rpx;
			z-index: 1;
		}


		.con {
			z-index: 2;
			margin-top: -50rpx;
			width: 100%;
			height: 1190rpx;
			background-color: #f5f5f5;
			border-radius: 20px;


			.title {
				display: flex;
				justify-content: flex-start;
				align-items: center;
				height: 200rpx;

				image {
					border-radius: 50px;
					width: 100rpx;
					height: 100rpx;
				}
			}

			.parent {
				border-radius: 20px;
				width: 750rpx;
				height: 1000rpx;
				position: relative;
				overflow: hidden;
				overflow: auto;
				-ms-overflow-style: none;
				overflow: -moz-scrollbars-none;

				.content {
					width: 710rpx;
					position: absolute;
					border-radius: 20px;
					margin-right: 20rpx;
					margin-left: 20rpx;
					background-color: #fff;
				}
			}

		}
	}
</style>
